using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MetarCommonSupport
{
    public partial class FrmErrShow : Form
    {
        string errText;

        public string ErrText
        {
            get { return txtErr.Text; }
            set { txtErr .Text = value; }
        }
        public FrmErrShow()
        {
            InitializeComponent();
            MetarCommonSupport.ClsCommonFun.InitIcon(this);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        static FrmErrShow errForm = null;
        static FrmErrShow ErrForm
        {
            get 
            {
                if (errForm == null || errForm.IsDisposed)
                {
                    errForm = new FrmErrShow();
                }
                return errForm;
            }
        }
        public static void ShowErrMessage(string err)
        {
            bool blog = System.Configuration.ConfigurationManager.AppSettings["ShowErrMsg"] == "1";
            if (blog)
            {
                ErrForm.ErrText = err;
                ErrForm.ShowDialog();
            }
        }
    }
}